<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>v-html</title>
<script src="../js/vue.js"></script>
</head>
<body>
<div id="app">
	<button @click.prevent="addNodesFn">点击</button>
	<button @click.prevent="clear">clear</button>	
    <div v-html="rawHtml"></div>
</div>
<script>
 new Vue({
        el: '#app',
        data: {
            rawHtml: '\
                        <div>\
                            <h2>Vue 学习</h2>\
                            <p>工匠精神</p>\
                        </div>\
                        ',
			initHtml: '\
                        <div>\
                            <h2>Vue 学习</h2>\
                            <p>工匠精神</p>\
                        </div>\
                        '
        },
		mounted: function(){
		
			this.rawHtml = this.initHtml;
		},
        methods: {
            addNodesFn: function() {
                this.rawHtml += this.rawHtml;
            },
			clear: function() {
				this.rawHtml = '';
			}
        }
    });
</script>
</body>
</html>
